﻿using MongoDB.Bson;
using CRL.Data;
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
using System.Linq;
using System.Collections;
namespace MongoTest
{
    public class MongoDBModel
    {
        public int Id
        {
            get;
            set;
        }

        public string OrderId
        {
            get;
            set;
        }
        public int Number
        {
            get;
            set;
        }
        public string name
        {
            get; set;
        }
        public int Status
        {
            get; set;
        }
        public double Price
        {
            get; set;
        }
    }

    public class MongoDBModel2 : MongoDBModel
    {
    }
    public class MongoDBModel3 : MongoDBModel
    {
    }
    public class SearchHistory : IModel
    {
        //[CRL.Attribute.Field(IsPrimaryKey = true, KeepIdentity = true)]
        //public ObjectId _id
        //{
        //    get; set;
        //}
        public ObjectId Id { get; set; }
        public string OrgId { get; set; }
        public string CustomerId { get; set; }
        public string UserId { get; set; }
        public string KeyWord { get; set; }
        public DateTime Time { get; set; }
        public string IndexKey { get; set; }
        public decimal Hit
        {
            get; set;
        }
        public string GetIndexKey()
        {
            var key = string.Format("{0}_{1}_{2}", CustomerId, KeyWord, Time.Date);
            return key;
        }
    }
    public class ITest
    {
        protected static void Show<T>(T obj)
        {
            ConsoleTables.ConsoleTable.Display(obj);
        }
    }
}
